﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using QLTV_BLL;
using QLTV_Public;

namespace GUI
{
    public partial class frmThongTinChiTiet : DevExpress.XtraEditors.XtraForm
    {
        #region Khai báo biên
        CT_PhieuYeuCau_BLL ct_pyc_bll = new CT_PhieuYeuCau_BLL();
        public string maDocGia = "";
        TextMessageBox box = new TextMessageBox();
        #endregion

        #region LoadForm

        public frmThongTinChiTiet()
        {
            InitializeComponent();
        }

        private void frmThongTinChiTiet_Load(object sender, EventArgs e)
        {
            Load_Data();
        }

        #endregion

        #region cac chuc nang

        private void btnThoat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }

        #endregion

        #region ham viet them

        private void Load_Data()
        {
            DataTable dt_Gv = ct_pyc_bll.Load_ThongTinChiTiet_GiaoVien(maDocGia);
            DataTable dt_HV = ct_pyc_bll.Load_ThongTinChiTiet_HocVien(maDocGia);
            if (dt_Gv.Rows.Count > 0)
            {
                lblDanToc.Text = dt_Gv.Rows[0]["TenDanToc"].ToString();
                lblDonVi.Text = dt_Gv.Rows[0]["TenDonVi"].ToString();
                lblEmail.Text = dt_Gv.Rows[0]["Email"].ToString();
                lblGioiTinh.Text = dt_Gv.Rows[0]["GioiTinh"].ToString();
                lblHoTen.Text = dt_Gv.Rows[0]["HoVaTen"].ToString();
                lblLoaiThe.Text = dt_Gv.Rows[0]["TenLoaiThe"].ToString();
                lblNgaySinh.Text = dt_Gv.Rows[0]["NgaySinh"].ToString().Substring(0,10);
                lblSlDaMuon.Text = dt_Gv.Rows[0]["SoLuongDaMuon"].ToString();
                lblSLDuocMuon.Text = dt_Gv.Rows[0]["SoLuongDuocMuon"].ToString();
                lblSoDT.Text = dt_Gv.Rows[0]["SoDienThoai"].ToString();
                this.ClientSize = new System.Drawing.Size(607, 250);   
            }
            if (dt_HV.Rows.Count > 0)
            {
                lblDanToc.Text = dt_HV.Rows[0]["TenDanToc"].ToString();
                lblDonVi.Text = dt_HV.Rows[0]["TenDonVi"].ToString();
                lblEmail.Text = dt_HV.Rows[0]["Email"].ToString();
                lblGioiTinh.Text = dt_HV.Rows[0]["GioiTinh"].ToString();
                lblHoTen.Text = dt_HV.Rows[0]["HoVaTen"].ToString();
                lblLoaiThe.Text = dt_HV.Rows[0]["TenLoaiThe"].ToString();
                lblNgaySinh.Text = dt_HV.Rows[0]["NgaySinh"].ToString().Substring(0, 10);
                lblSlDaMuon.Text = dt_HV.Rows[0]["SoLuongDaMuon"].ToString();
                lblSLDuocMuon.Text = dt_HV.Rows[0]["SoLuongDuocMuon"].ToString();
                lblSoDT.Text = dt_HV.Rows[0]["SoDienThoai"].ToString();
                lblheDaoTao.Text = dt_HV.Rows[0]["TenHeDaoTao"].ToString();
                lblLop.Text = dt_HV.Rows[0]["TenLop"].ToString();
                this.ClientSize = new System.Drawing.Size(607, 352);    
            }
        }


        #endregion
    }
}